<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<script src="${pageContext.request.contextPath}/JS/jquery3.3.1.js"></script>
<link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/bootstrap-theme.min.css" rel="stylesheet">
<script src="${pageContext.request.contextPath}/JS/bootstrap.min.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%-- <script type="text/javascript" src="${pageContext.request.contextPath }/JS/jquery-1.11.0.min.js"></script> --%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--  <link href="${pageContext.request.contextPath }/css/flowersingle.css" rel="stylesheet" type="text/css" /> --%>
<title>Insert title here</title>
<style type="text/css">
#reset_myinfo_zon div{
	float:left;
}
#reset_myinfo_zon{
}
</style>
</head>
<body>
<%@ include file="/com/top.jsp" %>
<%@ include file="/com/top1.jsp" %>

<!-- 中间总的开始 -->
<div id = "reset_myinfo_zon" class = "" style = "min-width:1349px;width:1349px;height:800px;">
<%@ include file="/com/left.jsp" %>	

<!-- 中间正文部分开始 -->
<div id = "" class = "" style = "width:1175px;height:750px;
border-radius:10px;background-color:#2e2e2e;margin: 5px;">
	<div id = "reset_myinfo_word" class = "font_color" style = "width:100%;height:100px;
	line-height: 100px;font-size: 30px;font-weight: bold;
	text-align: center;background-color:#2e2e2e;border-radius:10px">
		个人信息修改页面
	</div>
	<!-- 表单开始 -->
	<div id = "" class = "" style = "margin-left: 80px;background-color:white;
	padding:10px;border-radius:15px;">
		<form id = "reset_myinfo_form" action="${pageContext.request.contextPath }/ResetMyInfoServlet" method = "post" enctype="multipart/form-data">
			<table class = "table table-bordered table-hover font_color" >
			  <tr>
			    <td>
				    <div id = "reset_myinfo_img_div" class = "" style = "width:100px;height:100px;">
						<img alt="" src="${pageContext.request.contextPath }${user_login.head}" id = "reset_myinfo_img" style = "width:100%;height:100%;">
					</div>
				</td>
			    <td style = "min-width:900px;">
			    	<div style = "font-size:27px;font-weight: bold;">${user_login.username }</div>
			    	<input type = "file" id = "img_file" name = "head" onchange = "showPreview(this)" class = "form-control" style = "display:none;background: url(img/222.jpg);color:#ff3535;"/>
			    	<a href = "#">
				    	<div class = "form-control" onclick = "$('#img_file').click()"  style = "margin-top: 20px;color:#ff3535;">
				    		修改用户头像
				    	</div>
			    	</a>
			    </td>
			  </tr>
			  <tr>
			    <td>个人简介</td>
			    <td>
			    	<textarea rows="" cols="" placeholder = "" disabled="disabled" class = "form-control" style = "" name = "detail">按时间大胜靠德静安寺啊实打实大师电饭锅电饭锅电饭锅地方电饭锅电饭锅地方规范化规范化股份恢复贵航股份
			    	</textarea>
			    </td>
			  </tr>
			  <tr>
			    <td>联系方式</td>
			    <td>
				    <div class="input-group">
						<span class="input-group-btn">
							<button class="btn btn-default" type="button">
								&nbsp
							</button>
						</span>
						<input type="text" value = "${user_login.phone }" class="form-control" name = "phone" id = "updown_out_price" >
					</div>
			    </td>
			  </tr>
			  <tr>
			    <td>年龄</td>
			    <td>
				    <div class="input-group">
						<span class="input-group-btn">
							<button class="btn btn-default" type="button">
								&nbsp
							</button>
						</span>
						<input type="text"  value = "${user_login.age }" class="form-control" name = "age" id = "updown_out_price">
					</div>
			    </td>
			  </tr>
			  <tr>
			  <tr>
			    <td>邮箱</td>
			    <td>
				    <div class="input-group">
						<span class="input-group-btn">
							<button class="btn btn-default" type="button">
								&nbsp
							</button>
						</span>
						<input type="text" class="form-control" value = "${user_login.email }"  name = "email" id = "updown_out_price">
					</div>
			    </td>
			  </tr>
			  <tr>
			    <td>地址</td>
			    <td>
				    <div class="input-group">
						<span class="input-group-btn">
							<button class="btn btn-default" type="button">
								&nbsp
							</button>
						</span>
						<input type="text" value = "${user_login.address }"  class="form-control" name = "address" id = "updown_out_price">
					</div>
			    </td>
			  </tr>
			  <tr>
			    <td>性别</td>
			    <td>
			    	<select class = "form-control"  id = "reset_myinfo_select" name = "gender">
			    		<option value = "男" id = "select_1">男</option>
			    		<option value = "女" id = "select_2">女</option>
			    	</select>
			    </td>
			  </tr>
			  <tr>
			    <td colspan="2" onclick = "reset()">
			    	<button type="button" class="btn btn-default btn-lg btn-block font_color" >确认修改</button>
			    </td>
			  </tr>
			</table>
		</form>
			
			
			
	</div><!-- 表单结束 -->

</div><!-- 中间正文部分结束 -->




</div><!-- 中间总的结束 -->


<script type="text/javascript">

$(function(){
	if("${user_login.gender}" == "女"){
		$("#reset_myinfo_select #select_2").attr("selected",'selected')
	}
})

//头像，电话，年龄，邮箱，地址，性别
function reset(){
	if(confirm('确认修改吗？')){
		$('#reset_myinfo_form').submit()	
	}
}

//如果不是商家则使左边栏失效
$(function(){
	if("${user_login.shopid}"==""){
		$("#left_order a").attr("href","#")
		$("#left_shop a").attr("href","#")
		$("#left_updown a").attr("href","#")
	}
})

</script>





<script type="text/javascript">
    function showPreview(source) {
        var file = source.files[0];
        if(window.FileReader) {
            var fr = new FileReader();
            fr.onloadend = function(e) {
                document.getElementById("reset_myinfo_img").src = e.target.result; //这个就是图片的流，可以直接展示到页面上
            };
            fr.readAsDataURL(file);
        }
    }
    
    $(function(){
    	$("#left_myinfo a").addClass("font_color")
    })
</script>



</body>
</html>